﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBTMDT.Dal;

namespace DBTMDT.Biz
{
    class BizUser
    {
        public int IDUser { get; set; }
        public string UserName { get; set; }
        public string Email { get; set; }
        public string Password { get; set; }
        public string TenUser { get; set; }
        public string SoDienThoai { get; set; }
        public DateTime NgaySinh { get; set; }
        public string DiaChi { get; set; }
        public decimal SoLuongBid { get; set; }






        public BizUser()
        {
            this.IDUser = -1;        
        }

        public BizUser(int IDUser, string UserName, string Email, string Password, string TenUser, string SoDienThoai, DateTime NgaySinh,string DiaChi,decimal SoLuongBid)
        {
            this.IDUser = IDUser;
            this.UserName = UserName;
            this.Email = Email;
            this.Password = Password;
            this.TenUser = TenUser;
            this.SoDienThoai = SoDienThoai;
            this.NgaySinh = NgaySinh;
            this.DiaChi = DiaChi;
            this.SoDienThoai = SoDienThoai;
        }

        public BizUser( string UserName, string Email, string Password, string TenUser, string SoDienThoai, DateTime NgaySinh, string DiaChi, decimal SoLuongBid)
        {
            
            this.UserName = UserName;
            this.Email = Email;
            this.Password = Password;
            this.TenUser = TenUser;
            this.SoDienThoai = SoDienThoai;
            this.NgaySinh = NgaySinh;
            this.DiaChi = DiaChi;
            this.SoDienThoai = SoDienThoai;
        }

        public void Save()
        {
            if (this.IDUser == -1)
                this.IDUser = DalUser.Insert(this);
            else
                DalUser.Update(this);            
        }


    }
}
